<template>
  <el-menu background-color="#545c64"
           text-color="#fff"
           active-text-color="#ffd04b"
           style="height: 100%;"
           :default-active="$store.state.activeIndex"
           :collapse="isCollapse"
           :collapse-transition="false"
           router
  >
    <el-menu-item index="1" class="item" @click="frontBtn">
      <i class="el-icon-s-home"></i>
      <span slot="title">首页</span>
    </el-menu-item>
    <el-submenu index="6" class="item">
      <template slot="title"><i class="el-icon-upload"></i>上报</template>
      <el-menu-item  @click.native="gouyao">购药数据上报</el-menu-item>
      <el-menu-item  @click.native="menjizhen">门急诊数据上报</el-menu-item>
      <el-menu-item  @click.native="bingan">病案数据上报</el-menu-item>
      <el-menu-item  @click.native="yizhu">医嘱数据上报</el-menu-item>
      <el-menu-item  @click.native="history">上报历史记录</el-menu-item>
    </el-submenu>
    <el-submenu index="7" class="item">
      <template slot="title"><i class="el-icon-message"></i>消息通知</template>
      <el-menu-item  @click.native="message">消息通知</el-menu-item>
    </el-submenu>
    <el-submenu index="8" class="item" v-if="this.$store.getters.isAdmin">
      <template slot="title"><i class="el-icon-message-solid"></i>消息管理</template>
      <el-menu-item  @click.native="messageManage">消息管理</el-menu-item>
    </el-submenu>
    <el-submenu index="4" class="item" v-if="this.$store.getters.isAdmin">
      <template slot="title"><i class="el-icon-first-aid-kit"></i>医院管理</template>
      <el-menu-item  @click.native="hoslist">医院列表</el-menu-item>
      <el-menu-item  @click.native="hoslistS">医院信息审核</el-menu-item>
    </el-submenu>
    <el-submenu index="5" class="item" v-if="this.$store.getters.isAdmin">
      <template slot="title"><i class="el-icon-user-solid"></i>用户管理</template>
      <el-menu-item  @click.native="userManage">用户列表</el-menu-item>
    </el-submenu>
    <el-submenu index="2" class="item">
      <template slot="title"><i class="el-icon-user"></i>用户信息</template>
      <el-menu-item  @click.native="geren">个人资料</el-menu-item>
      <el-menu-item  @click.native="mima">修改密码</el-menu-item>
    </el-submenu>
    <el-submenu index="3" class="item">
      <template slot="title"><i class="el-icon-first-aid-kit"></i>医院信息</template>
      <el-menu-item  @click.native="yiyuanxinxi">医院资料</el-menu-item>
    </el-submenu>
    <el-submenu index="9" class="item">
      <template slot="title"><i class="el-icon-data-analysis"></i>数据分析</template>
      <el-menu-item  @click.native="dataAnalysis">数据分析</el-menu-item>
    </el-submenu>
  </el-menu>
</template>

<script>
export default {
  name: "Aside",
  data() {
    return {
    }
  },
  props:{
    isCollapse:Boolean
  },
  methods:{
    frontBtn() {
      this.$router.push("/home/dataAnalysis").catch((err) => err);
    },
    geren(){
      this.$router.push("/home/userinfo").catch((err) => err);
    },
    mima(){
      this.$router.push("/home/userpassword").catch((err)=>err);
    },
    yiyuanxinxi(){
      this.$router.push("/home/info").catch((err)=>err);
    },
    hoslist(){
      this.$router.push("/home/list").catch((err)=>err);
    },
    hoslistS(){
      this.$router.push("/home/check").catch((err)=>err);
    },
    userManage(){
      this.$router.push("/home/usermanage").catch((err)=>err);
    },
    menjizhen(){
      this.$router.push("/home/upload2").catch((err)=>err);
    },
    gouyao(){
      this.$router.push("/home/upload1").catch((err)=>err);
    },
    bingan(){
      this.$router.push("/home/upload3").catch((err)=>err);
    },
    yizhu(){
      this.$router.push("/home/upload4").catch((err)=>err);
    },
    history(){
      this.$router.push("/home/uploadRecord").catch((err)=>err);
    },
    message(){
      this.$router.push("/home/received").catch((err)=>err);
    },
    messageManage(){
      this.$router.push("/home/messageManage").catch((err)=>err);
    },
    dataAnalysis(){
      this.$router.push("/home/dataAnalysis").catch((err)=>err);
    }
  },
  created() {
    this.$store.commit("updateActiveIndex", "1");
  }
}
</script>

<style scoped>

</style>